<script lang="ts" setup name="ActivityBox">
import { ActivityList } from "../activityList";
// import { onMounted } from "vue";
interface Props {
  data: ActivityList;
}
interface Emits {
  (name: "goDetail", value: string): void;
}
const props = defineProps<Props>();
const emits = defineEmits<Emits>();
</script>

<template>
  <div class="activity-content-box" @click="emits('goDetail', props.data.route)">
    <div class="img-box">
      <!-- <img :src="`/src/assets/icons/${props.data.icon}`" /> -->
      <img :src="props.data.icon" />
    </div>
    <div class="info-box">
      <div class="name">{{ props.data.name }}</div>
      <div class="remark">{{ props.data.remark }}</div>
    </div>
  </div>
</template>

<style lang="scss" scoped>
.activity-content-box {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  width: 100%;
  height: 116px;
  padding: 12px 16px 12px 12px;
  cursor: pointer;
  border: 1px solid #f0f1f5;
  border-radius: 10px;
  .img-box {
    width: 30%;
    height: 60px;
    margin-right: 12px;
    overflow: hidden;
    border-radius: 50%;
    img {
      width: 100%;
      height: 100%;
    }
  }
  .info-box {
    .name {
      display: -webkit-box;
      width: 100%;
      margin-top: 4px;
      margin-bottom: 8px;
      overflow: hidden;
      font-size: 18px;
      line-height: 22px;
      color: #666666;
      text-overflow: ellipsis;
      word-break: break-all;
      vertical-align: middle;
      -webkit-box-orient: vertical;
      -webkit-line-clamp: 1;
    }
    .remark {
      display: -webkit-box;
      width: 100%;
      margin-bottom: 0;
      overflow: hidden;
      font-size: 12px;
      color: #999999;
      text-overflow: ellipsis;
      word-break: break-all;
      -webkit-box-orient: vertical;
      -webkit-line-clamp: 2;
    }
  }
}
.activity-content-box:hover {
  box-shadow: 3px 3px 3px #afafaf;
  transform: translateY(-3px);
}
</style>
